#ifndef ROLLCREATEDIALOG_H
#define ROLLCREATEDIALOG_H

#include <QDialog>
#include "rollcadresearchdialog.h"
#include <QSqlQueryModel>
#include <QSqlTableModel>
#include "resulttablemodel.h"

namespace Ui {
class RollCreateDialog;
}

class RollCreateDialog : public QDialog
{
    Q_OBJECT

public:
    explicit RollCreateDialog(QWidget *parent = 0);
    ~RollCreateDialog();
    int addId;
    void closeEvent(QCloseEvent *event);

private slots:
    void on_cancelButton_clicked();
    void on_addButton_clicked();
    void receiveIdData(QStringList);
    void on_saveButton_clicked();
    void on_upButton_clicked();
    void on_downButton_clicked();
    void on_deleteButton_clicked();

private:
    Ui::RollCreateDialog *ui;
    RollCadreSearchDialog *cadreSearchDialog;
    QSqlTableModel* getOriginalModel();
    void initTable();
    void saveRoll();
    void updateRoll();
    ResultTableModel *tableModel;
};

#endif // ROLLCREATEDIALOG_H
